'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    await queryInterface.createTable('activites',
      {
        id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true },
        title: Sequelize.STRING,
        content: Sequelize.TEXT,
        user_id: Sequelize.INTEGER,
        images: Sequelize.STRING,
        plantforms: Sequelize.STRING,
        cooperations: Sequelize.STRING,
        del: Sequelize.BOOLEAN, // 发布人设置不可见
        top: Sequelize.BOOLEAN, // 置顶
        hot: Sequelize.BOOLEAN, // 热门可以不用 一个帖子 普通or hot or top 都是or 的关系. 不会出现又置顶又热门
        start: Sequelize.DATE,
        end: Sequelize.DATE,
        des: Sequelize.STRING,
        attach: Sequelize.STRING,
        watch: Sequelize.INTEGER,
        created_at: Sequelize.DATE,
        updated_at: Sequelize.DATE,
      }
    );
  },

  down: (queryInterface, Sequelize) => {
    /*
      Add reverting commands here.
      Return a promise to correctly handle asynchronicity.

      Example:
      return queryInterface.dropTable('users');
    */
  },
};
